package ldh.im.base.service;

import ldh.im.SaveMessageService;
import ldh.im.TransferData;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

public class LocalSaveMessageService implements SaveMessageService {

    private static LocalSaveMessageService instance = null;

    private BlockingDeque<TransferData> messageList = null;

    private LocalSaveMessageService() {
        messageList = new LinkedBlockingDeque<>();
    }

    public static LocalSaveMessageService getInstance() {
        if (instance == null) {
            synchronized (LocalSaveMessageService.class) {
                if (instance == null) {
                    instance = new LocalSaveMessageService();
                }
            }
        }
        return instance;
    }

//    @Override
//    public void saveMessage(TransferData transferData) {
//        messageList.add(transferData);
//    }

}
